﻿package {
	import flash.display.MovieClip;
	import fl.transitions.Tween;
	import fl.transitions.easing.*;
	import fl.motion.Animator;
	public class Duck extends MovieClip {
		var duck_animator:Animator;
		public var points:int;
		function Duck(pts:int): void {
			this.points=pts;
			trace("new Duck");
		}
		public function swim(): void {
			var swimTween: Tween = new Tween(this, "x", None.easeNone, 650, -100, 4, true);
		}
		public function hit():void {//添加函数hit
		
			var duck_xml:XML =<Motion duration="10" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*">
	<source>
		<Source frameRate="24" x="357" y="180.95" scaleX="1" scaleY="1" rotation="0" elementType="movie clip" symbolName="ducks" class="Duck">
			<dimensions>
				<geom:Rectangle left="-32" top="-61.5" width="66" height="61"/>
			</dimensions>
			<transformationPoint>
				<geom:Point x="0.5" y="0.5"/>
			</transformationPoint>
		</Source>
	</source>

	<Keyframe index="0" zDepth="0" tweenSnap="true">
		<tweens>
		</tweens>
	</Keyframe>

	<Keyframe index="9" zDepth="0" y="0.05000000000001137" scaleX="0.424" scaleY="0.475" rotation="180">
		<color>
			<Color alphaMultiplier="0.04"/>
		</color>
	</Keyframe>
</Motion>;
		duck_animator = new Animator(duck_xml, this);
		duck_animator.play();
		}
	}

}